﻿/*
=============================================================================
Author:魏宝辉通过CodeSmithe生成
CreatedTime:2012-12-12
Description:Agency_List三层结构数据访问层
=============================================================================
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using PWMIS.DataMap.Entity;
using FTchina.Models;//引入模型层
namespace FTchina.DAL
{
	public static partial class Agency_ListService
	{
		 
	 
			
		public static int DeleteAgency_ListById(long id)	
		{     
            Agency_List agency_List = new Agency_List();
            agency_List.Id = id;
            EntityQuery<Agency_List> query = new EntityQuery<Agency_List>(agency_List);
             return query.Delete(agency_List);
		}	
        
          //以标识列获得对象
        public static Agency_List GetAgency_ListById(long  id)
        {
            Agency_List agency_List = new Agency_List();
            agency_List.Id = id;
            EntityQuery<Agency_List> query = new EntityQuery<Agency_List>(agency_List);
            query.FillEntity(agency_List);
            return agency_List;
        }
		
	 
	 
       
        
        
        
		 
		 
		 public static int AddOrUpdateAgency_List(Agency_List agency_List)
        {
            Agency_List _agency_List = new Agency_List();

            EntityQuery<Agency_List> query = new EntityQuery<Agency_List>(_agency_List);
           _agency_List= agency_List;
           int i=(agency_List.Id==0)?
                 query.Insert(_agency_List): query.Update(_agency_List);
            return i;
        }
		
		 
	}
}

